<!DOCTYPE html>
<html>
<head lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="">
<title>海风商城_联系方式</title>
<link rel="stylesheet" href="/css/base.css"/>
<link rel="stylesheet" href="/css/index.css"/>
<link rel="shortcut icon" href="favicon.ico" />
{insert_scripts files="../../js/jquery-1.12.3.min.js"}
{insert_scripts files="../../js/swiper.min.js"}
<script>
        !function(){
            var htmlEl = document.getElementsByTagName('html')[0];
            var fitPage = function(){
                /* The calculate of with from zepto  */
                var w = htmlEl.getBoundingClientRect().width;
                w = Math.round(w);
                w = w > 640 ? 640: w;
                var newW = w/640 * 100;
                htmlEl.style.fontSize = newW + 'px';
            }
            fitPage();
            var t;
            var func = function(){
                clearTimeout(t);
                t = setTimeout(fitPage, 25);
            }
            window.addEventListener('resize', func);
        }();
    </script>
</head>
<body>
<!--header Start-->
<div class="header ">
  <div class="left fl">
    <a onclick="history.go(-1)" class="home">
    <img src="/images/hf/icon_back_n.png" class="ib">
    <i></i>
    </a>
  </div>
  <div class="tit">
    <h2><span class="title">修改联系方式</span></h2>
  </div>
  <div class="right fr">
  </div>
</div>
<!--header End  -->
<!--banner Start-->
<div class="wrapper">
  <div class="page-address">
    <div class="edit-box">
      <ul class="ui-list">
        <li class="ui-list-item">
        <div class="label">
          姓名
        </div>
        <div class="ui-input">
          <input placeholder="请输入姓名" class="username btn-disabled" name="consignee" maxlength="15" type="text" value="{$user_info.user_name}" readonly="true">
        </div>
        </li>
        <li class="ui-list-item">
        <div class="label">
          手机
        </div>
        <div class="ui-input">
          <input name="tel" maxlength="13" type="tel" value="{$user_info.phone}" readonly="true" class="btn-disabled">
        </div>
        </li>
        <li class="ui-list-item">
        <div class="label">
          QQ
        </div>
        <div class="ui-input">
          <input placeholder="请输入QQ" class="qq" name="qq" maxlength="13" type="tel" value="{$user_info.qq}">
        </div>
        </li>
        <li class="ui-list-item">
        <div class="label">
          邮箱
        </div>
        <div class="ui-input">
          <input placeholder="请输入邮箱" class="email" name="tel" maxlength="20" type="tel" value="{$user_info.email}">
        </div>
        </li>
      </ul>
      <div class="save-button">
        <a href="javascript:;" class="ui-button"><span>保存</span></a>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
    var _arr = Array();
    $(function(){
        $('.save-button').click(function(){
            var qq = $('.qq').val();
            var email = $('.email').val();      
            var user_name = $('.username').val();
            if( !user_name ){
                alert('请输入姓名'); return;
            }
            $.post('/mobile/user.php?act=edit_user', {'user_name':user_name,'email':email,'qq':qq}, function(data){
                var data = jsonToArray(data);
                if( data.status == 'ok' ){
                    location.href="/mobile/order.php?act=order_lise";
                }else{
                    alert(data.error);
                    return;
                }
            })
        })
    })

    function jsonToArray( obj ){
        JSON.parse(obj, function (key, value) { _arr[key] = value;});
        return _arr;
    }
</script>
</body>
</html>